package com.yxh.lib_base.ext.lifecycle

import android.app.Activity
import android.app.Application
import android.os.Bundle
import com.yxh.lib_base.util.LogUtils

/**
 * 作者　: hegaojian
 * 时间　: 20120/1/7
 * 描述　:
 */
class KtxLifeCycleCallBack : Application.ActivityLifecycleCallbacks {
    private val TAG = "ActivityLifecycle"

    override fun onActivityCreated(activity: Activity, savedInstanceState: Bundle?) {
        KtxActivityManger.pushActivity(activity)
        LogUtils.d( TAG,"onActivityCreated : ${activity.localClassName}")
    }
    override fun onActivityStarted(activity: Activity) {
        LogUtils.d( TAG,"onActivityStarted : ${activity.localClassName}")
    }

    override fun onActivityResumed(activity: Activity) {
        LogUtils.d( TAG,"onActivityResumed : ${activity.localClassName}")
    }

    override fun onActivityPaused(activity: Activity) {
        LogUtils.d( TAG,"onActivityPaused : ${activity.localClassName}")
    }


    override fun onActivityDestroyed(activity: Activity) {
        LogUtils.d( TAG,"onActivityDestroyed : ${activity.localClassName}")
        KtxActivityManger.popActivity(activity)
    }

    override fun onActivitySaveInstanceState(activity: Activity, outState: Bundle) {

    }

    override fun onActivityStopped(activity: Activity) {
        LogUtils.d( TAG,"onActivityStopped : ${activity.localClassName}")
    }


}